import {CameraStatus, CameraTextColor} from '../api/types/camera.ts'

export const CameraTextMap = {
  [CameraStatus.normal]: '正常',
  [CameraStatus.abnormal]: '异常',
  [CameraStatus.unbound]: '未绑定',
}
export const CameraColorMap = {
  [CameraStatus.normal]: CameraTextColor.normal,
  [CameraStatus.abnormal]: CameraTextColor.abnormal,
  [CameraStatus.unbound]: CameraTextColor.unbound,
}

export const useCameraStatus = (status: CameraStatus = 2) => {
  return {
    text: CameraTextMap[status],
    color: CameraColorMap[status],
  }
}
